//package com.gitee.yannzh.rune.core.base.controller;
//
//import cn.hutool.core.map.MapUtil;
//import cn.zhxu.bs.BeanSearcher;
//import cn.zhxu.bs.MapSearcher;
//import cn.zhxu.bs.SearchResult;
//import cn.zhxu.bs.util.MapUtils;
//import co.kutong.framework.core.base.form.Form;
//import co.kutong.framework.core.base.pagination.PageView;
//import co.kutong.framework.core.base.vo.BaseVO;
//import co.kutong.framework.core.base.vo.Response;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.GetMapping;
//
//import javax.servlet.http.HttpServletRequest;
//import java.util.Map;
//
//import static co.kutong.framework.core.constant.BaseConstants.Api.SEARCH;
//
//public abstract class PlusCRUDController<F extends Form, T> extends FastCRUDController<F, T> {
//
//
//    @Autowired
//    protected BeanSearcher beanSearcher;
//
//    @Autowired
//    protected MapSearcher mapSearcher;
//
//    @GetMapping(SEARCH)
//    public Response<?> search(HttpServletRequest request) {
//        // 一行代码，实现一个用户检索接口（MapUtils.flat 只是收集前端的请求参数）
//        Map<String, Object> params = MapUtils.flat(request.getParameterMap());
//        long pageSize = MapUtil.getLong(params,"pageSize",10L);
//        long pageNo = MapUtil.getLong(params,"pageNo",1L);
//        SearchResult<?> searchResult = beanSearcher.search(getVoClass(), params);
//        return Response.ok(PageView.of(searchResult.getDataList(), searchResult.getTotalCount().longValue(),pageSize,pageNo));
//    }
//
//
//    protected <V extends BaseVO> Class<V> getVoClass() {
//        return getService().getVoClass();
//    }
//}
